package com.edooteach.api.servcice;

import java.util.List;
import java.util.Map;
import com.edoomath.entity.mall.Sku;
import com.edoomath.entity.trade.PaymentRequest;
import com.edoomath.entity.trade.SalesOrder;
import com.edoomath.entity.user.User;
import com.edoomath.entity.user.UserAddress;

/**
 * 
 * @author mohanlan
 *
 */
public interface SalesOrderService extends DataService<SalesOrder> {
    
    /**
     * 
     * @param unionid
     * @return
     */
    public List<SalesOrder> list(User user);
    
    /**
     * 
     * @param user
     * @param userAddress
     * @param sku
     * @return
     */
    public SalesOrder create(User user, UserAddress userAddress, Sku sku, List<Long> courseIds);
    
    /**
     * 
     * @param id
     * @return
     */
    public SalesOrder load(Long id);
    
    /**
     * 
     * @param code
     * @return
     */
    public SalesOrder load(String code);
    
    /**
     * 
     * @param rechargeOrder
     * @param user
     * @param remoteIp
     * @return
     */
    public Map<String, Object> prepay(SalesOrder salesOrder, User user, String remoteIp);
    
    
    /**
     * 
     * @param paymentRequest
     * @param orderCode
     * @param payCode
     * @param payTime
     * @param amount
     * @return
     */
    public SalesOrder pay(PaymentRequest paymentRequest, String orderCode, String payCode, String payTime, int amount);

}
